package com.jmb.api.controller.APITEST.asserts;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jmb.api.common.result.Result;
import com.jmb.api.model.entity.ApiTestCaseAssertLog;
import com.jmb.api.service.ApiTestCaseAssertLogService;
import com.jmb.api.vo.api.ApiTestAssertLogVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "断言日志")
@RestController
@RequestMapping("/api/test/assert/log")
public class ApiTestAssertLogController {
    @Autowired
    private ApiTestCaseAssertLogService apiTestAssertLogService;

    // 断言日志
    @Operation(summary = "断言日志列表")
    @GetMapping
    public Result<IPage<ApiTestCaseAssertLog>> getAsserLogList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, ApiTestAssertLogVo apiTestAssertLogVo) {
        IPage<ApiTestCaseAssertLog> page = new Page<>(pageNum,pageSize);
        IPage<ApiTestCaseAssertLog> list = apiTestAssertLogService.getAssertLogList(page,apiTestAssertLogVo);
        return Result.ok(list);
    }

}
